extends "../calxsx_2_1/calxsx_2_1.gd"
func _init():
	pass
func _extInit():
	._extInit()
	chaName = "百川"                   # 角色的名称
	atkEff = "atk_dang" 
	xb = "水"
	lv = 4    
	addSkillTxt("[color=#FFFF00][鲤跃花见][/color]:[color=#FFCC22]鱼跃在花见，攻击敌方全体，造成190%水系物理伤害，并<溺水>5秒,使用后有25%的概率刷新CD[CD:16][/color]")
	addSkillTxt("[color=#000079]难相守[/color]·[color=#004b97]游[/color][color=#0066cc]闲[/color][color=#0080ff]自[/color][color=#46a3ff]若[/color]-[color=#00BBFF]和修罗一同上场时，每次受到攻击，不论是否闪避都恢复1%最大体力值[/color]")
	addCdSkill("lyhj",16)
	
func _castCdSkill(id):
	._castCdSkill(id)
	if id == "lyhj":
		var chas = getAllChas(1)
		var eff = sys.newEff("numHit", position, false, 1)
		eff.setText("鲤跃花见", "#FF0099")
		eff.anim.set_speed_scale(0.2)
		for i in chas:
			typeHurtCha(i,att.atk*1.9,Chara.HurtType.PHY,Chara.AtkType.SKILL)
			i.addBuff(bf.nishui.new(5))
			var sk= getSkill("lyhj")
			if sys.rndPer(25):
				sk.nowTime += sk.cd/(1+att.cd)

var nxs = 0
func _onBattleStart():
	._onBattleStart()
	nxs = 0
	for i in getAllChas(2):
		if i.chaName.find("修罗") > -1:
			nxs = 1

func _onHurt(atkInfo):
	._onHurt(atkInfo)
	if nxs == 1:
		plusHp(att.maxHp*0.01)


